home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 May: Tool Chest / Developer CD Series Tool Chest (Apple Computer)(May 1999).iso / Tool Chest / Development Kits / MPW etc / Miscellaneous / MrPlus / MrProf / Sample Data / cplus_sample2.cp < prev   
Encoding:
Text File  |  1997-03-05  |  913 b   |  37 lines  |  [TEXT/MPS ]

  1. //
  2. //    cplus_sample2 - utility portion of simple C++ program
  3. //
  4. //
  5. //    Copyright © 1993, Apple Computer, Inc.  All rights reserved.
  6. //
  7.  
  8. #include "cplus_sample.h"
  9. #include <Desk.h>
  10.  
  11. TSampleClass::TSampleClass ()
  12. {
  13.     /* The (char *) was necessary because CPlus creates a unsigned char temporary
  14.        and get's real unhappy. */
  15.        
  16.     strcpy (this->theMessage, (char *) "\pPress the Mouse Button to Continue...");
  17. }
  18.  
  19.  
  20. void TSampleClass::showMessage (WindowPtr theWindow)
  21. {    
  22.     SetPort (theWindow);
  23.     MoveTo (((theWindow->portRect.right-theWindow->portRect.left) / 2) - 
  24.              (StringWidth ((ConstStr255Param)theMessage) / 2), 
  25.              (theWindow->portRect.bottom-theWindow->portRect.top) / 2);
  26.     TextFont (systemFont);
  27.     DrawString ((ConstStr255Param)this->theMessage);
  28. }
  29.  
  30.  
  31. void TSampleClass::myPause ()
  32. {
  33.     while (!Button ())   /* wait for user to click */
  34.       SystemTask ();     /* Give some cpu time to other tasks. */
  35. }
  36.  
  37.